<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <style type="text/css">
            #a{
                width: 500px;
                height: 200px;
                position: absolute;
                left: 500px;
                top: 200px;
                padding-top: 100px;
                background-color:cornflowerblue;
                border: 1px black solid ;
                text-align: center;
            }
            #no{
                position: absolute;
                left: 100px;
                top: 100px;
            }
        </style>
        <script>
            function a(){
                var no = document.getElementById("no");
                no.style.left = Math.floor(Math.random()*450)+"px";
                no.style.top = Math.floor(Math.random()*280)+"px";
            }
            function b(){
                alert("干了，奥利给！哈哈")
            }
        </script>
    </head>
    <body>
        <div id="a" clas="a" style="color: red;">
            <span>抓到我了吗?</span><br />
            <button onclick="b()">yes</button>  <br />
            <button onmouseover="a()" id="no">no</button>
        </div>
    </body>
</html>

